;Copyright (c) Microsoft Corporation.  All rights reserved.
;Abstract:  DirectX Typography Services public API definitions.

DWRITE_FONT_FILE_TYPE_UNKNOWN = 0
DWRITE_FONT_FILE_TYPE_CFF = 1
DWRITE_FONT_FILE_TYPE_TRUETYPE = 2
DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION = 3
DWRITE_FONT_FILE_TYPE_TYPE1_PFM = 4
DWRITE_FONT_FILE_TYPE_TYPE1_PFB = 5
DWRITE_FONT_FILE_TYPE_VECTOR = 6
DWRITE_FONT_FILE_TYPE_BITMAP = 7

DWRITE_FONT_FACE_TYPE_CFF = 0
DWRITE_FONT_FACE_TYPE_TRUETYPE = 1
DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION = 2
DWRITE_FONT_FACE_TYPE_TYPE1 = 3
DWRITE_FONT_FACE_TYPE_VECTOR = 4
DWRITE_FONT_FACE_TYPE_BITMAP = 5
DWRITE_FONT_FACE_TYPE_UNKNOWN = 6

DWRITE_FONT_SIMULATIONS_NONE	= 0
DWRITE_FONT_SIMULATIONS_BOLD	= 1
DWRITE_FONT_SIMULATIONS_OBLIQUE = 2

DWRITE_FONT_WEIGHT_THIN = 100
DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200
DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200
DWRITE_FONT_WEIGHT_LIGHT = 300
DWRITE_FONT_WEIGHT_NORMAL = 400
DWRITE_FONT_WEIGHT_REGULAR = 400
DWRITE_FONT_WEIGHT_MEDIUM = 500
DWRITE_FONT_WEIGHT_DEMI_BOLD = 600
DWRITE_FONT_WEIGHT_SEMI_BOLD = 600
DWRITE_FONT_WEIGHT_BOLD = 700
DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800
DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800
DWRITE_FONT_WEIGHT_BLACK = 900
DWRITE_FONT_WEIGHT_HEAVY = 900
DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950
DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950

DWRITE_FONT_STRETCH_UNDEFINED = 0
DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1
DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2
DWRITE_FONT_STRETCH_CONDENSED = 3
DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4
DWRITE_FONT_STRETCH_NORMAL = 5
DWRITE_FONT_STRETCH_MEDIUM = 5
DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6
DWRITE_FONT_STRETCH_EXPANDED = 7
DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8
DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9

DWRITE_FONT_STYLE_NORMAL = 0
DWRITE_FONT_STYLE_OBLIQUE = 1
DWRITE_FONT_STYLE_ITALIC = 2

DWRITE_INFORMATIONAL_STRING_NONE = 0
DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE = 1
DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS = 2
DWRITE_INFORMATIONAL_STRING_TRADEMARK = 3
DWRITE_INFORMATIONAL_STRING_MANUFACTURER = 4
DWRITE_INFORMATIONAL_STRING_DESIGNER = 5
DWRITE_INFORMATIONAL_STRING_DESIGNER_URL = 6
DWRITE_INFORMATIONAL_STRING_DESCRIPTION = 7
DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL = 8
DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION = 9
DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL = 10
DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES = 11
DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES = 12
DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES = 13
DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES = 14
DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT = 15

struct DWRITEFONTMETRICS
       designUnitsPerEm dw ?
       ascent dw ?
       descent dw ?
       lineGap dw ?
       capHeight dw ?
       xHeight dw ?
       underlinePosition dw ?
       underlineThickness dw ?
       strikethroughPosition dw ?
       strikethroughThickness dw ?
ends

struct DWRITEGLYPHMETRICS
       leftSideBearing dd ?
       advanceWidth dd ?
       rightSideBearing dd ?
       topSideBearing dd ?
       advanceHeight dd ?
       bottomSideBearing dd ?
       verticalOriginY dd ?
ends

struct DWRITEGLYPHOFFSET
       advanceOffset dd ?
       ascenderOffset dd ?
ends

DWRITE_FACTORY_TYPE_SHARED = 0
DWRITE_FACTORY_TYPE_ISOLATED = 1

macro DWRITEMAKEOPENTYPETAG var,a,b,c,d {
      var = (a shl 24) + (b shl 16) + (c shl 8) + d
}

;727cad4e-d6af-4c9e-8a08-d695b11caa49
interface IDWriteLocalFontFileLoader,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateStreamFromKey,\
	  GetFilePathLengthFromKey,\
	  GetFilePathFromKey,\
	  GetLastWriteTimeFromKey

;b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2
interface IDWriteFontFileStream,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ReadFileFragment,\
	  ReleaseFileFragment,\
	  GetFileSize,\
	  GetLastWriteTime

;739d886a-cef5-47dc-8769-1a8b41bebbb0
interface IDWriteFontFile,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetReferenceKey,\
	  GetLoader,\
	  Analyze

DWRITE_PIXEL_GEOMETRY_FLAT = 0
DWRITE_PIXEL_GEOMETRY_RGB = 1
DWRITE_PIXEL_GEOMETRY_BGR = 2

DWRITE_RENDERING_MODE_DEFAULT = 0
DWRITE_RENDERING_MODE_BILEVEL = 1
DWRITE_RENDERING_MODE_CLEARTYPE_COMPATIBLE = 2
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL = 3
DWRITE_RENDERING_MODE_CLEARTYPE = 4
DWRITE_RENDERING_MODE_CLEARTYPE_SYMMETRIC = 5
DWRITE_RENDERING_MODE_OUTLINE = 6

struct DWRITEMATRIX
       m11 dd ?
       m12 dd ?
       m21 dd ?
       m22 dd ?
       dx dd ?
       dy dd ?
ends

;2f0da53a-2add-47cd-82ee-d9ec34688e75
interface IDWriteRenderingParams,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetGamma,\
	  GetEnhancedContrast,\
	  GetClearTypeLevel,\
	  GetPixelGeometry,\
	  GetRenderingMode

;5f49804d-7024-4d43-bfa9-d25984f53849
interface IDWriteFontFace,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetType,\
	  GetFiles,\
	  GetIndex,\
	  GetSimulations,\
	  IsSymbolFont,\
	  GetMetrics,\
	  GetGlyphCount,\
	  GetDesignGlyphMetrics,\
	  GetGlyphIndices,\
	  TryGetFontTable,\
	  ReleaseFontTable,\
	  GetGlyphRunOutline,\
	  GetRecommendedRenderingMode

;cca920e4-52f0-492b-bfa8-29c72ee0a468
interface IDWriteFontCollectionLoader,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateEnumeratorFromKey

;72755049-5ff7-435d-8348-4be97cfa6c7c
interface IDWriteFontFileEnumerator,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  MoveNext,\
	  GetCurrentFontFile

;08256209-099a-4b34-b86d-c22b110e7771
interface IDWriteLocalizedStrings,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCount,\
	  FindLocaleName,\
	  GetLocaleNameLength,\
	  GetLocaleName,\
	  GetStringLength,\
	  GetString

;a84cee02-3eea-4eee-a827-87c1a02a0fcc
interface IDWriteFontCollection,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetFontFamilyCount,\
	  GetFontFamily,\
	  FindFamilyName,\
	  GetFontFromFontFace

;1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb
interface IDWriteFontList,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetFontCollection,\
	  GetFontCount,\
	  GetFont

;da20d8ef-812a-4c43-9802-62ec4abd7add
interface IDWriteFontFamily,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetFamilyNames,\
	  GetFirstMatchingFont,\
	  GetMatchingFonts

;acd16696-8c14-4f5d-877e-fe3fc1d32737
interface IDWriteFont,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetFontFamily,\
	  GetWeight,\
	  GetStretch,\
	  GetStyle,\
	  IsSymbolFont,\
	  GetFaceNames,\
	  GetInformationalStrings,\
	  GetSimulations,\
	  GetMetrics,\
	  HasCharacter,\
	  CreateFontFace

DWRITE_READING_DIRECTION_LEFT_TO_RIGHT = 0
DWRITE_READING_DIRECTION_RIGHT_TO_LEFT = 1
DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM = 0

DWRITE_TEXT_ALIGNMENT_LEADING = 0
DWRITE_TEXT_ALIGNMENT_TRAILING = 1
DWRITE_TEXT_ALIGNMENT_CENTER = 2

DWRITE_PARAGRAPH_ALIGNMENT_NEAR = 0
DWRITE_PARAGRAPH_ALIGNMENT_FAR = 1
DWRITE_PARAGRAPH_ALIGNMENT_CENTER = 2

DWRITE_WORD_WRAPPING_WRAP = 0
DWRITE_WORD_WRAPPING_NO_WRAP = 1

DWRITE_LINE_SPACING_METHOD_DEFAULT = 0
DWRITE_LINE_SPACING_METHOD_UNIFORM = 1

DWRITE_TRIMMING_GRANULARITY_NONE = 0
DWRITE_TRIMMING_GRANULARITY_CHARACTER = 1
DWRITE_TRIMMING_GRANULARITY_WORD = 2

DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS = $63726661
DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS = $63703263
DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS = $63733263
DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES = $746c6163
DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS = $65736163
DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION = $706d6363
DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES = $67696c63
DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING = $70737063
DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH = $68777363
DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING = $73727563
DWRITE_FONT_FEATURE_TAG_DEFAULT = $746c6664
DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES = $67696c64
DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS = $74707865
DWRITE_FONT_FEATURE_TAG_FRACTIONS = $63617266
DWRITE_FONT_FEATURE_TAG_FULL_WIDTH = $64697766
DWRITE_FONT_FEATURE_TAG_HALF_FORMS = $666c6168
DWRITE_FONT_FEATURE_TAG_HALANT_FORMS = $6e6c6168
DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH = $746c6168
DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS= $74736968
DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES = $616e6b68
DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES = $67696c68
DWRITE_FONT_FEATURE_TAG_HALF_WIDTH = $64697768
DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS = $6f6a6f68
DWRITE_FONT_FEATURE_TAG_JIS04_FORMS = $3430706a
DWRITE_FONT_FEATURE_TAG_JIS78_FORMS = $3837706a
DWRITE_FONT_FEATURE_TAG_JIS83_FORMS = $3338706a
DWRITE_FONT_FEATURE_TAG_JIS90_FORMS = $3039706a
DWRITE_FONT_FEATURE_TAG_KERNING = $6e72656b
DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES = $6167696c
DWRITE_FONT_FEATURE_TAG_LINING_FIGURES = $6d756e6c
DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS = $6c636f6c
DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING = $6b72616d
DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK = $6b72676d
DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING = $6b6d6b6d
DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS = $746c616e
DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS = $6b636c6e
DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES = $6d756e6f
DWRITE_FONT_FEATURE_TAG_ORDINALS = $6e64726f
DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH = $746c6170
DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS = $70616370
DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES = $6d756e70
DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS = $64697770
DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS = $64697771
DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES = $67696c72
DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS = $79627572
DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES = $746c6173
DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS = $666e6973
DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS = $70636d73
DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS = $6c706d73
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1 = $31307373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2 = $32307373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3 = $33307373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4 = $34307373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5 = $35307373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6 = $36307373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7 = $37307373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8 = $38307373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9 = $39307373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10 = $30317373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11 = $31317373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12 = $32317373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13 = $33317373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14 = $34317373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15 = $35317373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16 = $36317373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17 = $37317373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18 = $38317373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19 = $39317373
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = $30327373
DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = $73627573
DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = $73707573
DWRITE_FONT_FEATURE_TAG_SWASH = $68737773
DWRITE_FONT_FEATURE_TAG_TITLING = $6c746974
DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = $6d616e74
DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = $6d756e74
DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = $64617274
DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = $64697774
DWRITE_FONT_FEATURE_TAG_UNICASE = $63696e75
DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = $6f72657a

struct DWRITETEXTRANGE
       startPosition dd ?
       length dd ?
ends

struct DWRITEFONTFEATURE
       nameTag dd ?
       parameter dd ?
ends

struct DWRITETYPOGRAPHICFEATURES
       features dq ?
       featureCount dd ?,?
ends

struct DWRITETRIMMING
       granularity dd ?
       delimiter dd ?
       delimiterCount dd ?
ends

;9c906818-31d7-4fd3-a151-7c5e225db55a
interface IDWriteTextFormat,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetTextAlignment,\
	  SetParagraphAlignment,\
	  SetWordWrapping,\
	  SetReadingDirection,\
	  SetFlowDirection,\
	  SetIncrementalTabStop,\
	  SetTrimming,\
	  SetLineSpacing,\
	  GetTextAlignment,\
	  GetParagraphAlignment,\
	  GetWordWrapping,\
	  GetReadingDirection,\
	  GetFlowDirection,\
	  GetIncrementalTabStop,\
	  GetTrimming,\
	  GetLineSpacing,\
	  GetFontCollection,\
	  GetFontFamilyNameLength,\
	  GetFontFamilyName,\
	  GetFontWeight,\
	  GetFontStyle,\
	  GetFontStretch,\
	  GetFontSize,\
	  GetLocaleNameLength,\
	  GetLocaleName

;55f1112b-1dc2-4b3c-9541-f46894ed85b6
interface IDWriteTypography,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddFontFeature,\
	  GetFontFeatureCount,\
	  GetFontFeature

DWRITE_SCRIPT_SHAPES_DEFAULT = 0
DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1

struct DWRITESCRIPTANALYSIS
       script dw ?
       shapes dd ?
ends

DWRITE_BREAK_CONDITION_NEUTRAL = 0
DWRITE_BREAK_CONDITION_CAN_BREAK = 1
DWRITE_BREAK_CONDITION_MAY_NOT_BREAK = 2
DWRITE_BREAK_CONDITION_MUST_BREAK = 3

struct DWRITELINEBREAKPOINT
       union
	   breakConditionBefore db ?
	   breakConditionAfter db ?
	   isWhitespace db ?
	   isSoftHyphen db ?
	   padding db ?
       ends
ends

DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE = 0
DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL = 1
DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE = 2
DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL = 3
DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL = 4

;interface 14885CC9-BAB0-4f90-B6ED-5C366A2CD03D : IDWriteNumberSubstitution : public IUnknown

struct DWRITESHAPINGTEXTPROPERTIES
       union
	   isShapedAlone dw ?
	   reserved dw ?
       ends
ends

struct DWRITESHAPINGGLYPHPROPERTIES
       union
	   justification dw ?
	   isClusterStart dw ?
	   isDiacritic dw ?
	   isZeroWidthSpace dw ?
	   reserved dw ?
       ends
ends

;688e1a58-5094-47c8-adc8-fbcea60ae92b
interface IDWriteTextAnalysisSource,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetTextAtPosition,\
	  GetTextBeforePosition,\
	  GetParagraphReadingDirection,\
	  GetLocaleName,\
	  GetNumberSubstitution

;5810cd44-0ca0-4701-b3fa-bec5182ae4f6
interface IDWriteTextAnalysisSink,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetScriptAnalysis,\
	  SetLineBreakpoints,\
	  SetBidiLevel,\
	  SetNumberSubstitution

;b7e6163e-7f46-43b4-84b3-e4e6249c365d
interface IDWriteTextAnalyzer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AnalyzeScript,\
	  AnalyzeBidi,\
	  AnalyzeNumberSubstitution,\
	  AnalyzeLineBreakpoints,\
	  GetGlyphs,\
	  GetGlyphPlacements

struct DWRITEGLYPHRUN
       fontFace dq ?
       fontEmSize dd ?
       glyphCount dd ?
       glyphIndices dq ?
       glyphAdvances dq ?
       glyphOffsets dq ?
       isSideways dd ?
       bidiLevel dd ?
ends

struct DWRITEGLYPHRUNDESCRIPTION
       localeName dq ?
       string dq ?
       stringLength dd ?,?
       clusterMap dq ?
       textPosition dd ?,?
ends

struct DWRITEUNDERLINE
       width dd ?
       thickness dd ?
       offset dd ?
       runHeight dd ?
       readingDirection dd ?
       flowDirection dd ?
       localeName dq ?
ends

struct DWRITESTRIKETHROUGH
       width dd ?
       thickness dd ?
       offset dd ?
       readingDirection dd ?
       flowDirection dd ?
       localeName dq ?
ends

struct DWRITELINEMETRICS
       length dd ?
       trailingWhitespaceLength dd ?
       newlineLength dd ?
       height dd ?
       baseline dd ?
       isTrimmed dd ?
ends

struct DWRITECLUSTERMETRICS
       width dd ?
       length dw ?
       union
	   canWrapLineAfter dw ?
	   isWhitespace dw ?
	   isNewline dw ?
	   isSoftHyphen dw ?
	   isRightToLeft dw ?
	   padding dw ?
      ends
ends

struct DWRITETEXTMETRICS
       left dd ?
       top dd ?
       width dd ?
       widthIncludingTrailingWhitespace dd ?
       height dd ?
       layoutWidth dd ?
       layoutHeight dd ?
       maxBidiReorderingDepth dd ?
       lineCount dd ?
ends

struct DWRITEINLINEOBJECTMETRICS
       width dd ?
       height dd ?
       baseline dd ?
       supportsSideways dd ?
ends

struct DWRITEOVERHANGMETRICS
       left dd ?
       top dd ?
       right dd ?
       bottom dd ?
ends

struct DWRITEHITTESTMETRICS
       textPosition dd ?
       length dd ?
       left dd ?
       top dd ?
       width dd ?
       height dd ?
       bidiLevel dd ?
       isText dd ?
       isTrimmed dd ?
ends

;8339FDE3-106F-47ab-8373-1C6295EB10B3
interface IDWriteInlineObject,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Draw,\
	  GetMetrics,\
	  GetOverhangMetrics,\
	  GetBreakConditions

;eaf3a2da-ecf4-4d24-b644-b34f6842024b
interface IDWritePixelSnapping,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  IsPixelSnappingDisabled,\
	  GetCurrentTransform,\
	  GetPixelsPerDip

;ef8a8135-5cc6-45fe-8825-c5a0724eb819
interface IDWriteTextRenderer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  DrawGlyphRun,\
	  DrawUnderline,\
	  DrawStrikethrough,\
	  DrawInlineObject

;53737037-6d14-410b-9bfe-0b182bb70961
interface IDWriteTextLayout,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetMaxWidth,\
	  SetMaxHeight,\
	  SetFontCollection,\
	  SetFontFamilyName,\
	  SetFontWeight,\
	  SetFontStyle,\
	  SetFontStretch,\
	  SetFontSize,\
	  SetUnderline,\
	  SetStrikethrough,\
	  SetDrawingEffect,\
	  SetInlineObject,\
	  SetTypography,\
	  SetLocaleName,\
	  GetMaxWidth,\
	  GetMaxHeight,\
	  GetFontCollection,\
	  GetFontFamilyNameLength,\
	  GetFontFamilyName,\
	  GetFontWeight,\
	  GetFontStyle,\
	  GetFontStretch,\
	  GetFontSize,\
	  GetUnderline,\
	  GetStrikethrough,\
	  GetDrawingEffect,\
	  GetInlineObject,\
	  GetTypography,\
	  GetLocaleNameLength,\
	  GetLocaleName,\
	  Draw,\
	  GetLineMetrics,\
	  GetMetrics,\
	  GetOverhangMetrics,\
	  GetClusterMetrics,\
	  DetermineMinWidth,\
	  HitTestPoint,\
	  HitTestTextPosition,\
	  HitTestTextRange

;5e5a32a3-8dff-4773-9ff6-0696eab77267
interface IDWriteBitmapRenderTarget,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  DrawGlyphRun,\
	  GetMemoryDC,\
	  SetPixelsPerDip,\
	  GetCurrentTransform,\
	  SetCurrentTransform,\
	  GetSize,\
	  Resize

;1edd9491-9853-4299-898f-6432983b6f3a
interface IDWriteGdiInterop,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateFontFromLOGFONT,\
	  ConvertFontToLOGFONT,\
	  ConvertFontFaceToLOGFONT,\
	  CreateFontFaceFromHdc,\
	  CreateBitmapRenderTarget

DWRITE_TEXTURE_BILEVEL_1x1 = 0
DWRITE_TEXTURE_CLEARTYPE_3x1 = 1
DWRITE_ALPHA_MAX = 255

;7d97dbf7-e085-42d4-81e3-6a883bded118
interface IDWriteGlyphRunAnalysis,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetAlphaTextureBounds,\
	  CreateAlphaTexture,\
	  GetAlphaBlendParams

;GUID_IDWriteFactory GUID $b859ee5a,$d838,$4b5b,<$a2,$e8,$1a,$dc,$7d,$93,$db,$48>
interface IDWriteFactory,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetSystemFontCollection,\
	  CreateCustomFontCollection,\
	  RegisterFontCollectionLoader,\
	  UnregisterFontCollectionLoader,\
	  CreateFontFileReference,\
	  CreateCustomFontFileReference,\
	  CreateFontFace,\
	  CreateRenderingParams,\
	  CreateMonitorRenderingParams,\
	  CreateCustomRenderingParams,\
	  RegisterFontFileLoader,\
	  UnregisterFontFileLoader,\
	  CreateTextFormat,\
	  CreateTypography,\
	  GetGdiInterop,\
	  CreateTextLayout,\
	  CreateDisplayTextLayout,\
	  CreateEllipsisTrimmingSign,\
	  CreateTextAnalyzer,\
	  CreateNumberSubstitution,\
	  CreateGlyphRunAnalysis

FACILITY_DWRITE = $898
DWRITE_ERR_BASE = $5000

DWRITE_E_FILEFORMAT = $88985000
DWRITE_E_UNEXPECTED = $88985001
DWRITE_E_NOFONT = $88985002
DWRITE_E_FILENOTFOUND = $88985003
DWRITE_E_FILEACCESS = $88985004
DWRITE_E_FONTCOLLECTIONOBSOLETE = $88985005
DWRITE_E_ALREADYREGISTERED = $88985006
